const { Schema, model } = require("mongoose");

const blogSchema = new Schema({
    __v: { type: Number, select: false },
    title: { type: String, required: true }, // 博客标题
    content: { type: String, required: true, select: false }, // 博客内容
    author: { type: Schema.Types.ObjectId, ref: "User", required: true }, // 作者
    createdAt: { type: Date, default: Date.now }, // 创建时间
});

module.exports = model("Blog", blogSchema);
